package sol.leetcode;

/**
 * Integer Break
 */
public class Issue343 {
    public static int integerBreak(int n) {
        if (n == 2) return 1;
        if (n == 3) return 2;
        int res = 1;
        while (n > 4) {
            n -= 3;
            res *= 3;
        }
        res *= n;
        return res;
    }

    public static void main(String[] args) {
        int n=9;
        int res = integerBreak(n);
        System.out.println(res);
    }
}
